package com.design.proxy.dbroute.db;

public class DynamicDataSourceEntity {

    public static final String DEFAULE_SOURCE = null;

    private static final ThreadLocal<String> local = new ThreadLocal<>();

    public DynamicDataSourceEntity() {
    }

    public static String get() {
        return local.get();
    }

    public static void restore() {
        local.set(DEFAULE_SOURCE);
    }


    public static void set(String source) {
        local.set(source);
    }

    public static void set(int year) {
        local.set("DB_" + year);
    }
}
